﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Panačik
{
    public partial class oknoProgramu : Form
    {
        int xPanáčika = 130;
        int yPanáčika = 130;

        int šírkaPanáčika = 40;
        int výškaPanáčika = 20;

        Image obrazok = Properties.Resources.panačik;



        public oknoProgramu()
        {
            InitializeComponent();
        }

        private void panel_Paint(object sender, PaintEventArgs e)
        {
            Graphics kp = e.Graphics;
            kp.DrawImage(obrazok, xPanáčika, yPanáčika, šírkaPanáčika, výškaPanáčika);


        }


        private void oknoProgramu_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.Left:
                    xPanáčika -= 5;
                    break;
                case Keys.Right:
                    xPanáčika += 5;
                    break;
                case Keys.Down:
                    yPanáčika += 5;
                    break;
                case Keys.Up:
                    yPanáčika -= 5;
                    break;
            }

            panel.Refresh();

        }
    }
}
